/*
 * Copyright (C) GSX Techedu Inc. All Rights Reserved
 * Unauthorized copying of this file, via any medium is strictly prohibited
 * Proprietary and confidential
 */

package com.nime.novel.crawl.mapper;

import com.nime.novel.crawl.domain.CrawlUrl;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * @author liujialiang
 * @description
 * @team wuhan operational dev.
 * @date 2020/8/27 10:20 上午
 **/
@Mapper
@Component
public interface CrawlUrlMapper {

    CrawlUrl getOldUrlByStatus(@Param("policyId") Integer policyId, @Param("channel") Integer channel, @Param("crawlStatus") Integer crawlStatus);

    CrawlUrl getNewUrlByStatus(@Param("policyId") Integer policyId, @Param("channel") Integer channel, @Param("crawlStatus") Integer crawlStatus);

    CrawlUrl getById(@Param("id") Long id);

    int create(CrawlUrl crawlUrl);

    CrawlUrl findByUrlHash(@Param("urlHash") String urlHash);

    int updateStatus(@Param("id") Long id, @Param("status") Integer status);

    int updateRoute(@Param("id") Long id, @Param("route") String status);
}
